#ifndef CNC_UI_KEYBOARD_H
#define CNC_UI_KEYBOARD_H

#include "vkeyboard.h"
#include "vkbd_.h"
#include <bcm/bcm.h>

namespace cnc {

	namespace ui {

		class UIKeyboard : public bcm::Identifier<bcm::Component>,
			UIKeyboardImpl
		{
		protected:
			UIKeyboard() : bcm::Identifier<bcm::Component>("uikbd", "User Interface Virtual Keyboard")
			{
			}
		protected:
			virtual bcm::IdentifierData *getProvidedInterfaceTable()
			{
				static bcm::IdentifierData idData[] = {
					{ "taskctl", "Task Control" },
					{ "vkbd", "Virtual Keyboard" },
					{ 0, 0 }
				};
				return idData;
			}
			virtual bcm::IdentifierData *getRequiredInterfaceTable()
			{
				static bcm::IdentifierData idData[] = {
					{ 0, 0 }
				};
				return idData;
			}
			virtual bcm::Interface *getInterface(const char *id)
			{
				if (std::string("taskctl") == id)
					return getTaskControl();
				else if (std::string("vkbd") == id)
					return getVirtualKeyboard();
				return 0;
			}
			virtual bool setInterface(bcm::Interface *iface)
			{
				return false;
			}
		public:
			static UIKeyboard &instance(bcm::GetComponentResult *result)
			{
				static UIKeyboard object;
				if (result != 0)
					*result = object.result_;
				return object;
			}
		};

	} // namespace ui

} // namespace cnc

#endif

